// #ifdef MP-WEIXIN
let Channelaa = function() {
	const info = uni.getAccountInfoSync()
	// const version = info.miniProgram.envVersion // 'develop' | 'trial' | 'release'
	const version ='release' // 'develop' | 'trial' | 'release'
	console.log('环境变量：' + version)
	switch (version) {
		case 'develop':
			return "https://dev.mall.senda360.com"
			// return 'http://192.168.1.54:8005'
			// return"https://mall.senda360.com"
			break
		case 'trial':
			return "https://mall.senda360.com"
			break
		case 'release':
			return "https://mall.senda360.com"
			break
		default:
			this.envName = '未知版本'
	}
}

module.exports.ctrl = Channelaa()
module.exports.Channel = Channelaa()



let wenUrl = () => {
	const info = uni.getAccountInfoSync()
	// const version = info.miniProgram.envVersion // 'develop' | 'trial' | 'release'
	let version =  'release'// 'develop' | 'trial' | 'release'
	console.log('环境变量：' + version)
	switch (version) {
		case 'develop':
			return 'ws://192.168.1.54:9528/ws/'
			break
		case 'trial':
			return "wss://dev.mall.senda360.com/ws/"
			break
		case 'release':
			return "wss://mall.senda360.com/ws/"
			break
		default:
			this.envName = '未知版本'
	}
}


module.exports.wsUrl = wenUrl()


// #endif

// #ifdef MP-XHS 

module.exports.ctrl = "https://mall.senda360.com"
module.exports.Channel = "https://mall.senda360.com"
module.exports.wsUrl = "wss://mall.senda360.com/ws/"

// #endif

// #ifdef MP-TOUTIAO
	let doy =  function doy(){
		const envInfo =  tt.getEnvInfoSync();
		console.log("当前运行环境：", envInfo.microapp.envType);
		// 根据环境类型处理逻辑
		switch (envInfo.microapp.envType) {
			case 'development': // 开发版
				console.log("开发环境");
				return "https://dev.mall.senda360.com"
				break;
			case 'preview': // 体验版
				console.log("测试环境");
				return "https://dev.mall.senda360.com"
				break;
			case 'production': // 线上版
				console.log("生产环境");
				return "https://mall.senda360.com"
				break;
		}
	}
	module.exports.ctrl = doy()
	module.exports.Channel = doy()

// #endif